package com.demo.webapp.views.freemarker.directive.core.validation.exception;

import java.util.List;

/**
 * 参数验证异常
 * @author ryuu.kk
 *
 */
public class ParameterValidateException extends Exception {

	/**
	 * 序列化ID
	 */
	private static final long serialVersionUID = 8878709816852609245L;

	/**
	 * 消息列表
	 */
	private List<String> messageList;
	
	public ParameterValidateException(List<String> messageList) {
		super("自定义指令出错.");
		this.messageList = messageList;
	}

	@Override
	public String getMessage() {
		String error = super.getMessage();
		if (messageList != null) {
			for (String message : messageList) {
				error += message + "\r\t";
			}
		}
		return error;
	}
	public List<String> getMessageList() {
		return messageList;
	}
}
